<%@ page import="com.study.notepad.bean.Note" %><%--
  Created by IntelliJ IDEA.
  User: Cedar
  Date: 2019/12/1
  Time: 18:51
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ include file="heder.jsp" %>

<html>
<%
    Note note = (Note) request.getAttribute("note");
    if (note == null) {
        request.setAttribute("save", true);
    } else {
        request.setAttribute("save", false);
    }
%>
<head>
 <c:if test="${save=='true'}">
     <title>新增记事</title>
</c:if>
<c:if test="${save=='false'}">
    <title>修改记事</title>
</c:if>
</head>
<style>

    body {
        text-align: center;
    }

    textarea {
        height: 100px;
        width: 300px;
    }

    .content {
        height: 100px;
        line-height: 100px;
    }

</style>
<body>
<c:if test="${save=='true'}">
   <form name="form" action="note/saveNote" method="post">
</c:if>
<c:if test="${save=='false'}">
  <form name="from" action="note/updateById" method="post">
</c:if>

      <input hidden name="id" value="${note.id}">
      <p>标题：<input name="title" value="${note.title}"/></p>
      <div class="content"><span>内容：</span><textarea id="content" name="content">${note.content}</textarea></div>
      <p><input type="submit" name="submit" value="提交"></p>
</form>
</body>
</html>
